package com.dkd.easybook.service.impl;

import java.util.List;

import com.dkd.common.annotation.DataScope;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dkd.easybook.mapper.EbUserNoteCategoryMapper;
import com.dkd.easybook.domain.EbUserNoteCategory;
import com.dkd.easybook.service.IEbUserNoteCategoryService;

/**
 * 用户笔记类别Service业务层处理
 * 
 * @author itheima
 * @date 2024-12-13
 */
@Service
public class EbUserNoteCategoryServiceImpl implements IEbUserNoteCategoryService 
{
    @Autowired
    private EbUserNoteCategoryMapper ebUserNoteCategoryMapper;

    /**
     * 查询用户笔记类别
     * 
     * @param userCategoryId 用户笔记类别主键
     * @return 用户笔记类别
     */
    @Override
    public EbUserNoteCategory selectEbUserNoteCategoryByUserCategoryId(Long userCategoryId)
    {
        return ebUserNoteCategoryMapper.selectEbUserNoteCategoryByUserCategoryId(userCategoryId);
    }

    /**
     * 查询用户笔记类别列表
     * 
     * @param ebUserNoteCategory 用户笔记类别
     * @return 用户笔记类别
     */
    @DataScope(deptAlias = "d", userAlias = "u")
    @Override
    public List<EbUserNoteCategory> selectEbUserNoteCategoryList(EbUserNoteCategory ebUserNoteCategory)
    {
        return ebUserNoteCategoryMapper.selectEbUserNoteCategoryList(ebUserNoteCategory);
    }

    /**
     * 新增用户笔记类别
     * 
     * @param ebUserNoteCategory 用户笔记类别
     * @return 结果
     */
    @Override
    public int insertEbUserNoteCategory(EbUserNoteCategory ebUserNoteCategory)
    {
        return ebUserNoteCategoryMapper.insertEbUserNoteCategory(ebUserNoteCategory);
    }

    /**
     * 修改用户笔记类别
     * 
     * @param ebUserNoteCategory 用户笔记类别
     * @return 结果
     */
    @Override
    public int updateEbUserNoteCategory(EbUserNoteCategory ebUserNoteCategory)
    {
        return ebUserNoteCategoryMapper.updateEbUserNoteCategory(ebUserNoteCategory);
    }

    /**
     * 批量删除用户笔记类别
     * 
     * @param userCategoryIds 需要删除的用户笔记类别主键
     * @return 结果
     */
    @Override
    public int deleteEbUserNoteCategoryByUserCategoryIds(Long[] userCategoryIds)
    {
        return ebUserNoteCategoryMapper.deleteEbUserNoteCategoryByUserCategoryIds(userCategoryIds);
    }

    /**
     * 删除用户笔记类别信息
     * 
     * @param userCategoryId 用户笔记类别主键
     * @return 结果
     */
    @Override
    public int deleteEbUserNoteCategoryByUserCategoryId(Long userCategoryId)
    {
        return ebUserNoteCategoryMapper.deleteEbUserNoteCategoryByUserCategoryId(userCategoryId);
    }
}
